Methods and systems for diagnosing magnetic sensors

ABSTRACT

A method includes generating a reference voltage by periodically switching direction of current flow in a diagnostic sensor, where the reference voltage is a non-sinusoidal differential voltage of which an amplitude alternates between minimum and maximum values, and where the reference voltage includes a diagnostic sensor output voltage component responsive to an external magnetic field and a diagnostic sensor offset voltage component responsive to a mismatch of the diagnostic sensor. The method also includes amplifying the reference voltage to produce an amplified reference voltage, where the amplified reference voltage is a differential voltage having an amplifier offset voltage component. Additionally, the method includes demodulating the amplified reference voltage by filtering the diagnostic sensor offset voltage component and the amplifier offset voltage component to produce a demodulated voltage. Also, the method includes digitizing the demodulated voltage to produce a digitized voltage.

CROSS REFERENCE TO RELATED APPLICATION

This application is a Divisional Application of U.S. Pat. ApplicationNo. 17/161,009 filed Jan. 28, 2021, which claims priority to U.S.Provisional Application No. 63/030,601, filed May 27, 2020, entitled“Methods for Run Time Diagnostics in Magnetic Sensors”, whichApplications are hereby incorporated by reference herein in theirentireties.

TECHNICAL FIELD

This description relates generally to magnetic sensors.

BACKGROUND

A magnetic sensor such as a Hall-effect sensor is a device used tomeasure the strength of a magnetic field. The magnetic sensor providesan output voltage that is directly proportional to the magnetic fieldstrength. Magnetic sensors are used for proximity sensing, position andspeed detection, and current sensing. A Hall-effect sensor can becombined with a threshold detection circuit so that it acts as a switch.

Due to safety requirements in automotive applications, run timediagnostics are performed on Hall-effect sensors to validate theirintegrity. A known magnetic field is typically created and isolated froman external magnetic field for run time diagnostics. Current systemsinclude on-chip coils built inside integrated circuits to create a localmagnetic field. Current systems require additional on-chip area andconsume significant amount of power. Also, current systems typically arenot reliable due to challenges associated with isolating the localmagnetic field from the external magnetic field.

SUMMARY

In one aspect, a method includes generating a reference voltage byperiodically switching direction of current flow in a diagnostic sensor,where the reference voltage is a nonsinusoidal differential voltage ofwhich an amplitude alternates between minimum and maximum values, andwhere the reference voltage includes a diagnostic sensor output voltagecomponent responsive to an external magnetic field and a diagnosticsensor offset voltage component responsive to a mismatch of thediagnostic sensor. The method also includes amplifying the referencevoltage to produce an amplified reference voltage, where the amplifiedreference voltage is a differential voltage having an amplifier offsetvoltage component. Additionally, the method includes demodulating theamplified reference voltage by filtering the diagnostic sensor offsetvoltage component and the amplifier offset voltage component to producea demodulated voltage. Also, the method includes digitizing thedemodulated voltage to produce a digitized voltage.

In another aspect, a circuit includes a magnetic sensor having a firstsensor terminal, a second sensor terminal, a third sensor terminal, anda fourth sensor terminal and a diagnostic sensor having a firstdiagnostic terminal, a second diagnostic terminal, a third diagnosticterminal, and a fourth diagnostic terminal. The circuit also includes afirst multiplexer coupled to the first sensor terminal and to the firstdiagnostic terminal and a second multiplexer coupled to the secondsensor terminal and the second diagnostic terminal. Additionally, thecircuit includes a third multiplexer coupled to the third sensorterminal, the fourth sensor terminal, the first diagnostic terminal, thesecond diagnostic terminal, the third diagnostic terminal, and thefourth diagnostic terminal, the third multiplexer having a firstdifferential output terminal and a second differential output terminal.

In another aspect, a vehicle includes a magnetic sensor circuit. Themagnetic sensor circuit includes a magnetic sensor having a first sensorterminal, a second sensor terminal, a third sensor terminal, and afourth sensor terminal and a diagnostic sensor having a first diagnosticterminal, a second diagnostic terminal, a third diagnostic terminal, anda fourth diagnostic terminal. The magnetic sensor circuit also includesa first multiplexer coupled to the first sensor terminal and to thefirst diagnostic terminal and a second multiplexer coupled to the secondsensor terminal and the second diagnostic terminal. Additionally, themagnetic sensor circuit includes a third multiplexer coupled to thethird sensor terminal, the fourth sensor terminal, the first diagnosticterminal, the second diagnostic terminal, the third diagnostic terminal,and the fourth diagnostic terminal, the third multiplexer having a firstdifferential output terminal and a second differential output terminal.Also, the magnetic sensor circuit includes an analog front end (AFE)coupled to the third multiplexer, a demodulator coupled to the AFE, andan analog to digital converter (ADC) coupled to the demodulator.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a magnetic sensor circuit of an exampleembodiment.

FIG. 2 illustrates a timing diagram.

FIG. 3 is a schematic diagram of a magnetic sensor of an exampleembodiment.

FIG. 4 is a block diagram of a test circuit of an example embodiment.

FIG. 5 is a flow diagram of an example embodiment.

DETAILED DESCRIPTION

FIG. 1 is a block diagram of a magnetic sensor circuit 100 of an exampleembodiment. The magnetic sensor circuit 100 operates in two modes: adiagnostic mode and a normal mode. In the diagnostic mode, the magneticsensor circuit 100 performs a self-diagnosis to validate the signalchain integrity of the circuit 100. In the normal mode, the magneticsensor circuit 100 measures an external magnetic field and provides anoutput voltage representative of the external magnetic field.

The magnetic sensor circuit 100 operates in duty cycles having a sleepstate and an active state. As illustrated in a timing diagram 200 ofFIG. 2 , in a sleep state 204 the magnetic sensor circuit 100 isinactive, and in an active state 208 the magnetic sensor circuit 100performs a signal chain diagnostic check 210 and a sensor diagnosticcheck 214. Thereafter, the magnetic sensor circuit 100 performs a normaloperation 218 which is also referred to as Hall-effect sensor operation.

The magnetic sensor circuit 100 includes three magnetic sensors 104A,104B, and 104C oriented to measure external magnetic fields in x, y, andz directions, respectively. The magnetic sensor circuit 100 may beconstructed with any suitable number of magnetic sensors. The magneticsensors 104A, 104B, and 104C may, for example, be Hall-effect sensorswhich provide an output voltage representative of the strength of theexternal magnetic fields.

The magnetic sensor circuit 100 includes a diagnostic sensor 108 whichprovides an output voltage that is immune to the external magneticfield. In an example embodiment, the diagnostic sensor 100 is builtusing resistors (e.g., poly resistors) that do not produce a voltageresponsive to the external magnetic field. The resistors in thediagnostic sensor 100 can be connected in a wheatstone bridge network.The diagnostic sensor 108 is used to perform a self-diagnosis to checkthe integrity of the signal chain of the circuit 100. The diagnosticsensor 108 may, for example, be a resistor network insensitive to theexternal magnetic field.

The magnetic sensors 104A, 104B, and 104C include respective bias inputterminals 110A, 110B and 110C configured to receive a bias current.During the normal operating mode, a switch S1 couples the bias inputinput terminals 110A, 110B and 110C to a current source I_(bias) whichprovides the bias current. The switch S1 may be implemented with amultiplexer.

The magnetic sensors 104A, 110B, and 104C include respective bias outputterminals 112A, 112B and 112C. During the normal operating mode, aswitch S2 couples the bias output terminals 112A, 112B and 112C to afirst termnial 116 of a switch M1. The switch S2 may, for example, be amultiplexer. The switch M1 has a second terminal 118 coupled to a groundterminal. The ground terminal may be coupled to a ground voltage. Theswitch M1 may, for example, be an n-channel field effect transistor(NFET) of which the first terminal 116 is a drain and the secondterminal 118 is a souce. The switch M1 also has a gate. When M1 isturned on, a conduction path is provided for the bias current to flowfrom the current source I_(bias) to ground.

The magnetic sensor 104A includes measurement terminals 122A and 122B,the magnetic sensor 104B includes measurement terminals 124A and 124B,and the magnetic sensor 104C includes measurement terminals 126A and126B. Responsive to the external magnetic field, the magnetic sensors104A, 104B and 104C provide output voltages at the measurementterminals. The output voltage at the measurement terminals isrepresentative of the strength of the external magnetic field. A switchS3 (e.g., a multiplexer) selectively couples the measurement terminalsto differential output terminals 128 and 130. During the normaloperating mode, the output voltages generated by the magnetic sensors104A, 104B and 104C are available at the differential output terminals128 and 130.

The diagnostic sensor 108 includes a bias input terminal 134 and a biasoutput terminal 136. The diagnostic sensor 108 includes measurementterminals 138 and 140. During the diagnostic mode, the switch S1 couplesthe bias input terminal 134 to the current source I_(bias) and theswitch S2 couples the bias output terminal 136 to the first terminal 116of the transistor M1, thus providing a conduction path between thecurrent source I_(bias) and ground. Also, during the diagnostic mode,the switch S3 couples the measurement terminals 138 and 140 to thedifferential output terminals 128 and 130. The diagnostic sensor 108provides an output voltage immune to the external magnetic field at themeasurement terminals 138 and 140.

The magnetic sensor circuit 100 includes an analog front end (AFE) 150which may be an amplifier. The AFE 150 includes differential inputs 152and 154 coupled to the differential outputs 128 and 130, respectively.During the diagnostic mode, a switch S4 connects a current source,I_(diagsrc), to the 152 input of the AFE 150 and a switch S5 connects acurrent sink, I_(diagsnk) to the input 154 of the AFE 150. The AFE 150applies a predetermined gain to the differential voltage provided by themagnetic sensors 104A-104C or the diagnostic sensor 108 and provides anamplified differential signal at outputs 156 and 158. The magneticsensor circuit 100 includes a demodulator 160 coupled to receive theamplified differential signal at inputs 162 and 164. The demodulator 160demodulates the amplifed signal and provides a filtered signal at anoutput 166. An analog-to-digital converter (ADC) 168 digitizes thefiltered signal.

In an example embodiment, the magnetic sensor circuit 100 includes anoperational amplifier 170 having first and second input terminals 172and 174, respectively, coupled to the respective differential outputterminals 128 and 130, of the third switch S3 and a third input terminal176 coupled to a common mode terminal to which a common mode voltage canbe applied. The operational amplifier 170 also includes an outputterminal 178 coupled to a gate of the switch M1. Responsive to thedifferential voltages at the terminals 128 and 130 and a common modevoltage, the operational amplifier 170 applies a gate voltage to theswitch M1 to control the current through M1, and thus control thecurrent in the magnetic sensors 104A-104C and the diagnostic sensor 108.

In an example embodiment, the magnetic sensors 104A-104C and thediagnostic sensor 108 are implemented with four resistors connected in awheatstone bridge configuration. FIG. 3 illustrates a sensor 300 whichmay be one of the magnetic sensors 104A-104C or the diagnostic sensor108. The sensor 300 comprises four resistors R1, R2, R3 and R4 connectedin a bridge configuration defining first, second, third and fourthterminals, T1, T2, T3 and T4, respectively. The sensor 300 is operatedin four phases, and in each phase a different pair of opposed terminalsis selected as the bias input and bias output terminals while the otherpair of opposed terminals is selected as the measurement terminals. Forexample, in phase 1, terminals T1 and T3 may be selected as the biasinput and output terminals, respectively, while the two opposedterminals T2 and T4 may be selected as the measurement terminals. Duringphase 1, the switch S1 couples the current source I_(bias) to terminalT1. Thus, the bias current flows through the resistors R1, R2, R3 and R4and out via terminal T3. Responsive to an external magnetic field H1,the sensor 300 provides an output voltage at the measurement terminalsT2 and T4. The switch S3 couples the measurement terminals T2 and T4during phase 1 to the differential output terminals 128 and 130.

In phase 2, terminals T2 and T4 may be selected as the bias input andoutput terminals, respectively, while the two opposed terminals T1 andT3 may be selected as the measurement terminals. During phase 2, theswitch S1 couples the current source I_(bias) to terminal T2. Thus, thebias current flows through the resistors R1, R2, R3 and R4 and out viaterminal T4. Responsive to an external magnetic field H1, the sensor 300provides an output voltage at the measurement terminals T1 and T3. Theswitch S3 couples the measurement terminals T1 and T3 during phase 2 tothe differential output terminals 128 and 130.

In phase 3, terminals T3 and T1 may be selected as the bias input andoutput terminals, respectively, while the two opposed terminals T2 andT4 may be selected as the measurement terminals. During phase 3, theswitch S1 couples the current source I_(bias) to terminal T3. Thus, thebias current flows through the resistors R1, R2, R3 and R4 and out viaterminal T1. Responsive to an external magnetic field H1, the sensor 300provides an output voltage at the measurement terminals T2 and T4. Theswitch S3 couples the measurement terminals T2 and T4 during phase 2 tothe differential output terminals 128 and 130.

In phase 4, terminals T4 and T2 may be selected as the bias input andoutput terminals, respectively, while the two opposed terminals T1 andT3 may be selected as the measurement terminals. During phase 4, theswitch S1 couples the current source I_(bias) to terminal T4. Thus, thebias current flows through the resistors R1, R2, R3 and R4 and out viaterminal T2. Responsive to an external magnetic field H1, the sensor 300provides an output voltage at the measurement terminals T1 and T3. Theswitch S3 couples the measurement terminals T1 and T3 during phase 2 tothe differential output terminals 128 and 130.

By coupling the current source I_(bias) to a different bias inputterminal during each phase, the direction of current flow in the sensor300 is periodically changed. As a result, a periodic non-sinusoidalvoltage is generated at the measurement terminals of the sensor 300. Theamplitude of the non-sinusoidal voltage at the measurement terminalsalternates between minumum and maximum values.

During the diagnostic mode, the magnetic sensor circuit 100 isconfigured to check the integrity of the magnetic sensors 104A-104C bymeasuring the magnetic sensor offset and the offset of the AFE 150. Inthis mode the current souce I_(bias) provides a current with apredetermined value to the magnetic sensors. The direction of currentflow in the magnetic sensor 104A-104C is periodically switched.Responsive to the external magnetic field the magnetic sensor provides aperiodic non-sinusoidal voltage, which is referred to as a hall voltage,at the differential output terminals 128 and 130. The output voltagecomprises a diagnostic sensor offset voltage component and a magneticsensitive diagnostic sensor output voltage component corresponding tothe current source, I_(bias), the resistance of the magnetic sensor andthe external magnetic field. The offset component is generated due to amismatch of the resistors of the sensor, and the magnetic sensitivevoltage component is generated by the magnetic sensor which isresponsive to the external magnetic field. Since the external magneticfield might be an unknown value during the diagnostic mode it isnecessary to ignore its effect. The signal at the differential outputterminals 128 and 130 is amplified by the AFE 150. At the output of theAFE 150, an offset component is added due to a mismatch in the AFE 150.The signal at the output of the AFE 150 can be represented as:

-   V_(ph(i)) = (-1)^(i+1) V_(Hall) + V_(OS,Hall,ph(i)) + V_(OS,AFE),    where:-   V_(ph(i)) = AFE output signal for each phase (1, 2, 3 and 4)-   V_(Hall) = Hall-effect voltage component-   V_(OS,Hall,ph(i)) = Hall sensor offset voltage component-   V_(OS,AFE) = AFE offset voltage component

Based on the above:

V_(ph(1))+V_(ph(2))+V_(ph(3))+V_(ph(4))=4(V_(OS,Hall,ph(i))+V_(OS,AFE))

The magnetic sensor integrity may be determined from the sum of theoffset of the magnetic sensors and the analog front end as shown beloweven in the presence of an unknown external magnetic field.

(V_(OS,Hall,ph(i))+V_(OS,AFE))=(1/4)(V_(ph(1))+V_(ph(2))+V_(ph(3))+V_(ph(4)))

In normal operation, the sensor output corresponding to the externalfield is demodulated using the demodulator 160 as below:

V_(ph(1))-V_(ph(2))+V_(ph(3))-V_(ph(4))=4(V_(Half))

During the diagnostic mode, the circuit 100 is configured to verify thesignal chain integrity using the dianostic sensor 108. In an exampleemodiment, in the diagnostic mode, in addition to the bias currentI_(bias), diagnostic current sources I_(diagsrc) and sink I_(diagsnk)are applied to the diagnostic sensor 108. The diagnostic current sourceI_(diagsrc) can be connected to the differential terminals 128 and 130by a switch S4 and the diagnostic current sink, I_(diagsnk) can beconnected to the differential terminals 128 and 130 by a switch S5. Theswitch S3 connects the differential terminals 128 and 130 to thediagnostic sensor 108 and thus applies the diagnostic current sourceI_(diagsrc) and the diagnostic current sink, I_(diagsnk) to thediagnostic sensor 108. The diagnostic current source I_(diagsrc) and thediagnostic current sink, I_(diagsnk) have predetermined values and canbe referred to as reference currents to the diagnostic sensor 108.

The direction of current flow of I_(bias), I_(diagsrc) and I_(diagsn) isperiodically switched in the diagnostic sensor 108. In phase 1 and phase3, a terminal 180 of the diagnostic current source is switched to theterminal 152 and a terminal 182 of the diagnostic current sink isswitched to the terminal 154. In phase 2 and phase 4, the terminal 180of the diagnostic current source is switched to the terminal 154 and theterminal 182 of the diagnostic current sink is switched to the terminal152. Immune to the external magnetic field and I_(bias) the diagnosticsensor 108 provides a periodic non-sinusoidal voltage, which is referredto as a diagnostic reference voltage at the differential outputterminals 128 and 130. Both the diagnostic currents (I_(diagsrc),I_(diagsnk)) may have the same value (I_(diagsrc)). The diagnosticreference voltage comprises a diagnostic sensor offset component and aknown diagnostic reference voltage component corresponding to thediagnostic current sources (I_(diagsrc)) and the resistance of thediagnostic sensor, R_(diagsns). The diagnostic sensor offset componentis generated due to a mismatch of the resistors of the diagnostic sensor108, and the known diagnostic reference voltage component is generatedby the diagnostic sensor 108 immune to the external magnetic field anddue to the voltage drop created by the reference diagnostic currentsflowing through the diagnostic sensor. Since the diagnostic referencecurrents have a known value, the resulting diagnostic reference voltagecomponent also has a known value. The signal at the differential outputterminals 128 and 130 is amplified by the AFE 150. At the output of theAFE 150, an offset component is added to the signal due to a mismatch inthe AFE 150. The signal at the output of the AFE 150 can be representedas:

-   V_(ph(i)) = (-1)^(i+1) V_(ref,diag) + V_(OS,Hall,ph(i)) +    V_(OS,AFE), where:-   V_(ph(i)) = AFE output signal for each phase (1, 2, 3 and 4)-   V_(ref,diag) = I_(diagsrc)*R_(diagsns) (Diagnostic Reference Voltage    Component)-   V_(OS,diag,ph(i)) = Diagnostic sensor offset voltage component-   V_(OS,AFE) = AFE offset voltage component

Based on the above: [0048]

V_(ph(1))-V_(ph(2))+V_(ph(3))-V_(ph(4))=4(V_(ref,diag))

Thus, the signal chain integrity may be determined by obtaining a knownoutput reference voltage based on demodulation of the four differentphases:

(V_(ref,diag))=(1/4)(V_(ph(1))-V_(ph(2))+V_(ph(3))-V_(ph(4)))

In an example embodiment, the magnetic sensor circuit 100 is configuredto perform a sensor integrity check to verify the sensitivity of themagnetic sensors 104A-104C. FIG. 4 illustrates a simplified circuit 400for the sensor integrity check of the magnetic sensor 104A. The biasinput terminal 110A of the magnetic sensor 104A is coupled to thecurrent source and the bias output terminal 112A is coupled to the drain116 of the transistor M1. During the sensor integrity check, the currentsource generates a current I_(diag) using a known voltage V_(diag) and aresistor R_(diag). Responsive to I_(diag), which has a known value, themagnetic sensor 104A provides a differential output voltage V(d1-d2)which can be representated as:

V(d1-d2)=(I_(diag))*(R_(Hall))

Where R_(Hall) is the equivalent resistance of the magnetic sensor 104.

After substituting (V_(bg)/R_(diag)) for I_(diag):

V(d1-d2)=(V_(bg)/R_(diag))*R_(Hall)=K*V_(bg)

Where K=R_(Hall)/R_(diag) and is defined as the sensitivity constant.

Thus, by measuring the differential voltage V(d1-d2) responsive to aknown current value, the sensitivity of the magnetic sensor 104A can bedetermined. As discussed before, the differential voltage can bedetermined from the output of the ADC 168 converter which provides adigital signal representative of the differential voltage.

FIG. 5 is a flow diagram of a method of diagnosing the signal chain of amagnetic sensor circuit of an example embodiment. In a block 504, areference voltage is generated by periodically switching direction ofcurrent flow in a diagnostic sensor. The reference voltage is anon-sinusoidal differential voltage of which the amplitude alternatesbetween minimum and maximum values. The reference voltage comprises adiagnostic sensor output voltage component responsive to a magneticfield and a diagnostic sensor offset voltage component resulting from amismatch of the diagnostic sensor. In a block 508, the reference voltageis amplified by an analog front end. The amplified voltage is adifferential voltage which includes an amplifier offset voltagecomponent. In a block 512, the amplified reference voltage isdemodulated by filtering the diagnostic sensor offset voltage componentand the amplifier offset voltage component. In a block 516, thedemodulated signal is digitized. The signal chain is diagnosed using thedigitized signal and comparing to the reference voltage.

Various illustrative components, blocks, modules, circuits, and stepshave been described above in general terms of their functionality.Whether such functionality is implemented as hardware or softwaredepends upon the particular application and design constraints imposedon the overall system. The described functionality may be implemented invarying ways for each particular application, but such implementationdecision should not be interpreted as causing a departure from the scopeof the present disclosure.

For simplicity and clarity, the full structure and operation of allsystems suitable for use with the present disclosure is not beingdepicted or described herein. Instead, only so much of a system as isunique to the present disclosure or necessary for an understanding ofthe present disclosure is depicted and described.

What is claimed is:
 1. A method comprising: generating a referencevoltage by periodically switching direction of current flow in adiagnostic sensor, wherein the reference voltage is a non-sinusoidaldifferential voltage of which an amplitude alternates between minimumand maximum values, and wherein the reference voltage comprises adiagnostic sensor output voltage component responsive to an externalmagnetic field and a diagnostic sensor offset voltage componentresponsive to a mismatch of the diagnostic sensor; amplifying thereference voltage to produce an amplified reference voltage, wherein theamplified reference voltage is a differential voltage having anamplifier offset voltage component; demodulating the amplified referencevoltage by filtering the diagnostic sensor offset voltage component andthe amplifier offset voltage component to produce a demodulated voltage;and digitizing the demodulated voltage to produce a digitized voltage.2. The method of claim 1, further comprising comparing the digitizedvoltage to the reference voltage.
 3. The method of claim 1, furthercomprising generating the reference voltage by periodically switchingdirection of current flow in the diagnostic sensor by switching to anadjacent terminal and an opposed terminal as a bias input terminal and abias output terminal, respectively, and switching to the other twoterminals as measurement terminals.
 4. The method of claim 1, wherein atransition between the minimum and maximum values is instantaneous.
 5. Acircuit comprising: a magnetic sensor having a first sensor terminal, asecond sensor terminal, a third sensor terminal, and a fourth sensorterminal; a diagnostic sensor having a first diagnostic terminal, asecond diagnostic terminal, a third diagnostic terminal, and a fourthdiagnostic terminal; a first multiplexer coupled to the first sensorterminal and to the first diagnostic terminal; a second multiplexercoupled to the second sensor terminal and to the second diagnosticterminal; and a third multiplexer coupled to the third sensor terminal,to the fourth sensor terminal, to the first diagnostic terminal, to thesecond diagnostic terminal, to the third diagnostic terminal, and to thefourth diagnostic terminal, the third multiplexer having a firstdifferential output terminal and a second differential output terminal.6. The circuit of claim 5, wherein the magnetic sensor is a firstmagnetic sensor, the circuit further comprising: a second magneticsensor having a fifth sensor terminal, a sixth sensor terminal, aseventh sensor terminal, and an eighth sensor terminal, the fifth sensorterminal coupled to the second multiplexer, the sixth sensor terminalcoupled to the second multiplexer, the seventh sensor terminal coupledto the third multiplexer, and the eighth sensor terminal coupled to thethird multiplexer; and a third magnetic sensor having a ninth sensorterminal, a tenth sensor terminal, an eleventh sensor terminal, and atwelfth sensor terminal, the ninth sensor terminal coupled to the firstmultiplexer, the tenth sensor terminal coupled to the secondmultiplexer, the eleventh sensor terminal coupled to the thirdmultiplexer, and the twelfth sensor terminal coupled to the thirdmultiplexer.
 7. The circuit of claim 5, further comprising: a firstswitch coupled to the first differential output terminal and to thesecond differential output terminal; a first current source coupled tothe first switch; a second switch coupled to the third multiplexer; anda second current source coupled to the second switch.
 8. The circuit ofclaim 7, further comprising: an analog front end (AFE) having a firstAFE input, a second AFE input, a first AFE output, and a second AFEoutput, the first AFE input coupled to the first differential outputterminal and the second AFE input coupled to the second differentialoutput terminal; and a demodulator having a first demodulator input, asecond demodulator input, a first demodulator output, and a seconddemodulator output, the first demodulator input coupled to the first AFEoutput and the second demodulator input coupled to the second AFEoutput.
 9. The circuit of claim 8, wherein the first switch isconfigured to: couple the first current source to the first AFE input;and couple the second switch to the second AFE input.
 10. The circuit ofclaim 7, further comprising a current source coupled to the firstmultiplexer.
 11. The circuit of claim 10, futher comprising: anoperational amplifier having a first amplifier input, a second amplifierinput, a third amplifier input, and an amplifier output, the firstamplifier input coupled to the first differential output terminal andthe second amplifier input coupled to the second differential outputterminal; and a transistor having a first current terminal, a secondcurrent terminal, and a control terminal, the control terminal coupledto the amplifier output and the first current terminal coupled to thesecond multiplexer.
 12. The circuit of claim 11, wherein the firstmultiplexer is configured to couple the first diagnostic terminal to thecurrent source and the second multiplexer is configured to couple thesecond diagnostic terminal to the first current terminal.
 13. Thecircuit of claim 5, wherein the third multiplexer is configured tocouple the third diagnostic terminal to the first differential outputterminal and the fourth diagnostic terminal to the second differentialoutput terminal.
 14. The circuit of claim 5, wherein the diagnosticsensor comprises: a first resistor having a first resistor terminal anda second resistor terminal; a second reisistor having a third resistorterminal and a fourth resistor terminal, the third resistor terminalcoupled to the first resistor terminal, the first resistor terminal andthe third resistor terminal coupled to the first multiplexer and to thethird multiplexer; a third resistor having a fifth resistor terminal anda sixth resistor terminal, the fifth resistor terminal coupled to thethird resistor terminal, the third resistor terminal and the fifthresistor terminal coupled to the third multiplexer; and a fourthresistor having a seventh resistor terminal and an eighth resistorterminal, the seventh resistor terminal coupled to the second resistorterminal, the second resistor terminal and the seventh resistor terminalcoupled to the third multiplexer, the eighth resistor terminal coupledto the sixth resistor terminal, the sixth resistor terminal and theeighth resistor terminal coupled to the second multiplexer and to thethird multiplexer.
 15. The circuit of claim 5, wherein: during a firstphase, the first diagnostic terminal is a bias input terminal, thesecond diagnostic terminal is a bias output terminal, the thirddiagnostic terminal is a first measurement terminal, and the fourthdiagnostic terminal is a second measurement terminal; during a secondphase, the fourth diagnostic terminal is the bias input terminal, thethird diagnostic terminal is the bias output terminal, the firstdiagnostic terminal is the first measurement terminal, and the seconddiagnostic terminal is the second measurement terminal; during a thirdphase, the second diagnostic terminal is the bias input terminal, thefirst diagnostic terminal is the bias output terminal, the thirddiagnostic terminal is the first measurement terminal, and the fourthdiagnostic terminal is the second measurement terminal; and during afourth phase, the third diagnostic terminal is the bias input terminal,the fourth diagnostic terminal is the bias output terminal, the seconddiagnostic terminal is the first measurement terminal, and the firstdiagnostic terminal is the second measurement terminal.
 16. A vehiclecomprising: a magnetic sensor circuit comprising: a magnetic sensorhaving a first sensor terminal, a second sensor terminal, a third sensorterminal, and a fourth sensor terminal; a diagnostic sensor having afirst diagnostic terminal, a second diagnostic terminal, a thirddiagnostic terminal, and a fourth diagnostic terminal; a firstmultiplexer coupled to the first sensor terminal and to the firstdiagnostic terminal; a second multiplexer coupled to the second sensorterminal and to the second diagnostic terminal; a third multiplexercoupled to the third sensor terminal, to the fourth sensor terminal, tothe first diagnostic terminal, to the second diagnostic terminal, to thethird diagnostic terminal, and to the fourth diagnostic terminal, thethird multiplexer having a first differential output terminal and asecond differential output terminal; an analog front end (AFE) coupledto the third multiplexer; a demodulator coupled to the AFE; and ananalog to digital converter (ADC) coupled to the demodulator.
 17. Thevehicle of claim 16, further comprising: a first switch coupled to thefirst differential output terminal and to the second differential outputterminal; a first current source coupled to the first switch; a secondswitch coupled to the third multiplexer; and a second current sourcecoupled to the second switch.
 18. The vehicle of claim 17, futhercomprising: an operational amplifier having a first amplifier input, asecond amplifier input, a third amplifier input, and an amplifieroutput, the first amplifier input coupled to the first differentialoutput terminal and the second amplifier input coupled to the seconddifferential output terminal; and a transistor having a first currentterminal, a second current terminal, and a control terminal, the controlterminal coupled to the amplifier output and the first current terminalcoupled to the second multiplexer.
 19. The vehicle of claim 18, furthercomprising a current source coupled to the first multiplexer, whereinthe first multiplexer is configured to couple the first diagnosticterminal to the current source and the second multiplexer is configuredto couple the second diagnostic terminal to the first current terminal.20. The vehicle of claim 16, wherein the magnetic sensor is a firstmagnetic sensor, the magnetic sensor circuit further comprising: asecond magnetic sensor having a fifth sensor terminal, a sixth sensorterminal, a seventh sensor terminal, and an eighth sensor terminal, thefifth sensor terminal coupled to the second multiplexer, the sixthsensor terminal coupled to the second multiplexer, the seventh sensorterminal coupled to the third multiplexer, and the eighth sensorterminal coupled to the third multiplexer; and a third magnetic sensorhaving a ninth sensor terminal, a tenth sensor terminal, an eleventhsensor terminal, and a twelfth sensor terminal, the ninth sensorterminal coupled to the first multiplexer, the tenth sensor terminalcoupled to the second multiplexer, the eleventh sensor terminal coupledto the third multiplexer, and the twelfth sensor terminal coupled to thethird multiplexer.